package com.example.mapper;

import com.example.entity.Singer;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 操作singer相关数据接口
*/
public interface SingerMapper {

    /**
      * 新增
    */
    int insert(Singer singer);

    /**
      * 删除
    */
    int deleteById(Integer id);

    /**
      * 修改
    */
    int updateById(Singer singer);

    /**
      * 根据ID查询
    */
    Singer selectById(Integer id);

    /**
      * 查询所有
    */
    List<Singer> selectAll(Singer singer);

    @Select("select * from singer order by hot desc limit #{num}")
    List<Singer> selectTop(Integer num);
}